load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ingestcli",
    srcs = [
        "client.go",
        "ingest_err.go",
        "interface.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/ingestor/ingestcli",
    visibility = ["//visibility:public"],
    deps = [
        "//br/pkg/restore/split",
        "//pkg/ingestor/errdef",
        "//pkg/util",
        "//pkg/util/logutil",
        "//pkg/util/redact",
        "@com_github_gogo_protobuf//proto",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_kvproto//pkg/errorpb",
        "@com_github_pingcap_kvproto//pkg/import_sstpb",
        "@com_github_pingcap_kvproto//pkg/metapb",
        "@org_uber_go_atomic//:atomic",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "ingestcli_test",
    timeout = "short",
    srcs = [
        "client_test.go",
        "ingest_err_test.go",
    ],
    embed = [":ingestcli"],
    flaky = True,
    shard_count = 9,
    deps = [
        "//br/pkg/restore/split",
        "//pkg/ingestor/errdef",
        "//pkg/lightning/common",
        "//pkg/util",
        "@com_github_pingcap_kvproto//pkg/errorpb",
        "@com_github_pingcap_kvproto//pkg/import_sstpb",
        "@com_github_pingcap_kvproto//pkg/metapb",
        "@com_github_stretchr_testify//require",
    ],
)
